<extend name="template/base_index" />

<block name="area_header">

	<link rel="stylesheet" href="__CSS__/buysell.css">
</block>

<block name="area_body">
	<div class="head">
		<a href="{:U('Mybuysell/mysell')}"><i class="fa fa-chevron-left"></i></a>
		<span>订单信息</span>
	</div>
	<div class="progress">
		<if condition="$pay_status == 0"><!--等待您付款-->
			<img src="__IMG__/100.png">
		</if>
		<if condition="$order_status == 3"><!--待发货-->
			<img src="__IMG__/101.png">
		</if>
		<if condition="$order_status == 4"><!--已发货-->
			<img src="__IMG__/102.png">
		</if>
		<if condition="$order_status == 7"><!--交易成功-->
			<img src="__IMG__/103.png">
		</if>
		<if condition="$order_status == 8"><!--交易关闭-->
			<img src="__IMG__/104.png">
		</if>
	</div>
	<div class="adress">
		<ul>
			<li>收货人：{$express_contactinfo['contactname']}</li>
			<li>{$express_contactinfo['province']}省{$express_contactinfo['city']}{$express_contactinfo['area']}{$express_contactinfo['detailinfo']}</li>
			<li>{$express_contactinfo['mobile']}</li>
		</ul>
		<if condition="($order_code eq 4) OR ($order_code eq 5)">
			<div class="express">
				<ul>
					<li><span>物流信息</span></li>
					<li><i class="fa fa-truck"></i><p>{$express_contactinfo['expressname']}：{$express_contactinfo['expressno']}</p></li>
				</ul>
			</div>
		</if>
	</div>
	<div class="product">
		<img src="{$iteminfo['img']}">
		<table>
			<tr >
				<td colspan="2" class="property">{$iteminfo['name']}</td>
			</tr>
			<tr>
				<td class="property">售出价格</td>
				<td class="right">&yen;{$iteminfo['price']}</td>
			</tr>
			<tr>
				<td class="property">运费</td>
				<td class="right">&yen;{$iteminfo['post_price']}</td>
			</tr>
			<tr>
				<td class="property"><span id="sum">合计</span></td>
				<td class="right" id="sumyen">&yen;{$iteminfo['sumprice']}</td>
			</tr>
		</table>
		<div class="clear"></div>
	</div>
	<div class="sellinfo">
		<table>
			<tr>
				<td>买家昵称</td>
				<td>{$nickname}</td>
			</tr>
			<tr>
				<td>订单编号</td>
				<td>{$iteminfo['order_code']}</td>
			</tr>
			<tr>
				<td>成交时间</td>
				<td>{$iteminfo['createtime']|date="Y-m-d H:i:s",###}</td>
			</tr>
		</table>
	</div>
	<if condition="$order_status eq 3">
		<div class="footer">
			<center>
				<a href="{:U('Mybuysell/send_good',array('uid' => $express_contactinfo['uid'],'order_code' => $express_contactinfo['order_code']))}" class="weui_btn weui_btn_warn">我要发货</a>
			</center>
		</div>
	</if>
	<if condition="($order_status eq 4) or ($order_status eq 5)">
		<div class="footer">
			<center>
				<a href="http://m.kuaidi100.com/index_all.html?type={$express_contactinfo['expresscode']}&postid={$express_contactinfo['expressno']}" class="weui_btn weui_btn_default">查看物流</a>
			</center>
		</div>
	</if>
	<if condition="$order_status eq 8">
		<volist name="refund" id="refund">
			<if condition="($refund['order_code'] eq $iteminfo['order_code']) and ($refund['result'] eq 2)">
				<div class="footer">
					<center>
						<a data-href="{:U('Mybuysell/confirm_refund',array('order_code' => $refund['order_code']))}" class="sure-delete weui_btn weui_btn_warn">确认买家订单取消</a>
					</center>
				</div>
			</if>
		</volist>
	</if>
	<script src="__JS__/jquery-weui.min.js"></script>
	<script>

		$(function(){
			/*确认收货*/
			$(".sure-delete").bind("click", function() {
				var url = $(this).attr('data-href');
				$.confirm("您同意买家取消订单 系统将会把钱打到买家账户", function() {
					$.get(url,function(msg){
						if(msg){
							$.toast("确认成功");
							window.location.reload();
						}else{
							$.toast("不好意思 确认失败了");
						}
					});

				}, function() {
					//取消操作
				});
			});
		})
	</script>
</block>